package com.ruoyi.project.dict.dailyword.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import com.ruoyi.project.dict.dailyword.domain.Dailyword;
import com.ruoyi.project.dict.dailyword.mapper.DailywordMapper;
import com.ruoyi.project.dict.dailyword.service.IDailywordService;

/**
 * 每日一字Service业务层处理
 * 
 * @author shixiangwen
 * @date 2020-04-01
 */
@Service
@DataSource(DataSourceType.KKCUSER3)
public class DailywordServiceImpl implements IDailywordService {
	@Autowired
	private DailywordMapper dailywordMapper;

	/**
	 * 查询每日一字
	 * 
	 * @param wid 每日一字ID
	 * @return 每日一字
	 */
	@Override
	public Dailyword selectDailywordById(String wid) {
		return dailywordMapper.selectDailywordById(wid);
	}

	/**
	 * 查询每日一字列表
	 * 
	 * @param dailyword 每日一字
	 * @return 每日一字
	 */
	@Override
	public List<Dailyword> selectDailywordList(Dailyword dailyword) {
		return dailywordMapper.selectDailywordList(dailyword);
	}

	/**
	 * 新增每日一字
	 * 
	 * @param dailyword 每日一字
	 * @return 结果
	 */
	@Override
	public int insertDailyword(Dailyword dailyword) {
		return dailywordMapper.insertDailyword(dailyword);
	}

	/**
	 * 修改每日一字
	 * 
	 * @param dailyword 每日一字
	 * @return 结果
	 */
	@Override
	public int updateDailyword(Dailyword dailyword) {
		return dailywordMapper.updateDailyword(dailyword);
	}

	/**
	 * 删除每日一字对象
	 * 
	 * @param ids 需要删除的数据ID
	 * @return 结果
	 */
	@Override
	public int deleteDailywordByIds(String ids) {
		return dailywordMapper.deleteDailywordByIds(Convert.toStrArray(ids));
	}

	/**
	 * 删除每日一字信息
	 * 
	 * @param wid 每日一字ID
	 * @return 结果
	 */
	@Override
	public int deleteDailywordById(String wid) {
		return dailywordMapper.deleteDailywordById(wid);
	}
}
